<template>
  <view class="index_content">
    <!-- 轮播 -->
    <view class="content1" v-if="isDev === 'release'">
      <!-- <Carousel ref="carousel"/> -->
    </view>
    <!-- 商品列表 -->
    <view class="content3">
      <!-- <ItemBox v-if="isDev === 'release'" ref="itembox"/> -->
    </view>
  </view>
</template>

<script>
  // import Carousel from './components/carousel'
  // import ItemBox from './components/itembox'
  export default {
    components: {
      // Carousel,
      // ItemBox,
    },
    data() {
      return {
        questionList: [],
      }
    },
    computed:{
      isDev(){
        return this.$store.state.isDev
      },
    },
    onShareAppMessage(res) {
      // 小程序分享
      return {
        title: '您的好友呼唤您一起享优惠啦',
        desc: `${this.appNameCNY}是最好的比价平台，一定要感谢你的朋友`,
        path: `/pages/index/index`,
      }
    },
    created() {
    },
    methods: {
      nextPaging(){
        this.$refs.itembox.nextPaging()
      },
      refresh(){ // 下拉刷新
        this.$refs.itembox.getItemList('pullDown')
        if(this.$refs.carousel){ // 测试环境没有carousel，会报错，勿改！！！！
          this.$refs.carousel.getAdvertise()
        }
      },
    }
  }
</script>

<style scoped lang="scss">
  .index_content {
    animation: fadein 1s;
    min-height: 100%;
    background-color: white;
    .cu-bar.fixed,
    .nav.fixed {
      /* #ifdef MP-WEIXIN */
      width: calc(100% - 200upx);
      /* #endif */
      top: var(--status-bar-height);
      position: absolute;
    }
    .content1 {
      margin: 0 20upx 0x;
    }
    .content2 {
      margin-top: 40upx;
    }
    .content3 {
    }
    .content4 {
      margin: 0 40upx;
    }
  }
</style>
